From 03f5d5a5e41bc42835dc02774a27a5eb5d4d023b Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 10 Feb 2015 03:33:02 +0000 Subject: [PATCH] gl: Put shaders in static storage We are not changing the shader code. The compiler will hopefully put them in the .rodata section. --- gdk/gdkgl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c index e497ccc910..1d7d2d4bb9 100644 --- a/gdk/gdkgl.c +++ b/gdk/gdkgl.c @@ -146,7 +146,7 @@ bind_vao (GdkGLContextPaintData *paint_data) static void use_texture_2d_program (GdkGLContextPaintData *paint_data) { - const char *vertex_shader_code = + static const char *vertex_shader_code = "#version 150\n" "uniform sampler2D map;" "attribute vec2 position;\n" @@ -156,7 +156,7 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data) " gl_Position = vec4(position, 0, 1);\n" " vUv = uv;\n" "}\n"; - const char *fragment_shader_code = + static const char *fragment_shader_code = "#version 150\n" "varying vec2 vUv;\n" "uniform sampler2D map;\n" @@ -177,7 +177,7 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data) static void use_texture_rect_program (GdkGLContextPaintData *paint_data) { - const char *vertex_shader_code = + static const char *vertex_shader_code = "#version 150\n" "uniform sampler2DRect map;" "attribute vec2 position;\n" @@ -187,7 +187,7 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data) " gl_Position = vec4(position, 0, 1);\n" " vUv = uv;\n" "}\n"; - const char *fragment_shader_code = + static const char *fragment_shader_code = "#version 150\n" "varying vec2 vUv;\n" "uniform sampler2DRect map;\n" -- 2.30.2